﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using Ganosoft.Aspect;
using Ganosoft.Container;
using Quartz;

namespace GanoESB.Business
{
    internal class MessageBus : IMessageBus
    {
        [Bean]
        protected IServiceBus serviceBus;

        private IScheduler sched;

        #region IMessageBus 成员

        public MessageResponse Execute(string secretKey, MessageRequest req)
        {
            MessageResponse resp = new MessageResponse();

            try
            {
                resp = serviceBus.Execute(secretKey, req);
            }
            catch(Exception ex)
            {
                resp.StateCode = 1000;
                resp.StateText = ex.Message;
            }

            return resp;
        }

        #endregion
    }
}
